<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); ?>

<div id="center-wrap" class="ui-corner-tl ui-corner-tr">
	<div id="navigation" class="ui-corner-all"><ul><?php echo $navigator;?></ul></div>
	
	<div class="clrboth"></div>
	<?php 
		$ci=& get_instance();
		$USER = $ci->user_entity->init('id',$items->getUserCreatedId());
	?>
	<div class="row">
		
		<div class="clrboth"></div>
		<div class="column grid_9">
			<div class="column grid_2">Show Reference Number:</div>
			<div class="column grid_4 bold">
				<?php echo $items->getRefNo();?>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Show Name:</div>
			<div class="column grid_4">
				<?php echo $items->getName();?>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Type:</div>
			<div class="column grid_4">
				<?php $array = showTypeDataConfig(); echo $array[$items->getShowType()];?>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Duration:</div>
			<div class="column grid_4">
				<?php $array = durationOfShowDataConfig(); echo $array[$items->getShowDuration()];?>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Artist:</div>
			<div class="column grid_4">
				<?php echo $items->getArtist();?>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Country:</div>
			<div class="column grid_4">
				<?php $array = countryOriginDataConfig(); echo $array[$items->getCountryOriginCode()];?>	
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">&nbsp;</div>
			<div class="column grid_6">
				<?php if($items->getShowImage1()):?>
					<a href="<?php echo fileTarget($USER->getId(),$items->getShowImage1());?>" target="_blank"><img src="<?php echo thumb(fileTarget($USER->getId(),$items->getShowImage1()),150,150);?>" /> </a>
					&nbsp;&nbsp;&nbsp;
				<?php endif; ?>
				<?php if($items->getShowImage2()):?>
					<a href="<?php echo fileTarget($USER->getId(),$items->getShowImage2());?>" target="_blank"><img src="<?php echo thumb(fileTarget($USER->getId(),$items->getShowImage2()),150,150);?>" /> </a>
					&nbsp;&nbsp;&nbsp;
				<?php endif; ?>
				<?php if($items->getShowImage3()):?>
					<a href="<?php echo fileTarget($USER->getId(),$items->getShowImage3());?>" target="_blank"><img src="<?php echo thumb(fileTarget($USER->getId(),$items->getShowImage3()),150,150);?>" /> </a> 
					&nbsp;&nbsp;&nbsp;
				<?php endif; ?>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Music Genre:</div>
			<div class="column grid_6">
				<?php 
					$music_genre = array();
					$array = musicGenreDataConfig();
					foreach(explode(',',$items->getMusicGenre()) as $genre){
						if(!empty($genre)){
							$music_genre[] = $array[$genre] ;
						}	
					}
					echo implode(', ',$music_genre);
				?>
			</div>
			
			<div class="clrboth"></div>
			<div class="column grid_2">Speaker Profile:</div>
			<div class="column grid_6">
				<?php 
					$speaker_profile = array();
					$array = speakerProfileDataConfig();
					foreach(explode(',',$items->getSpeakerProfile()) as $profile){
						if(!empty($profile)){
							$speaker_profile[] = $array[$profile] ;
						}
					}
					echo implode(', ',$speaker_profile);
				?>
			</div>
			
			<div class="clrboth"></div>
			<div class="column grid_2">Plays & Musicals:</div>
			<div class="column grid_6">
				<?php 
					$play_musical = array();
					$array = playsMusicalsDataConfig();
					foreach(explode(',',$items->getPlaysMusicals()) as $p_m){
						if(!empty($p_m)){
							$play_musical[] = $array[$p_m] ;
						}
					}
					echo implode(', ',$play_musical);
				?>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Period of Travel:</div>
			<div class="column grid_6">
				<?php echo sbxDateFormat($items->getStartDate(),'d/M/Y')." - ".sbxDateFormat($items->getEndDate(),'d/M/Y');?> 
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Bid Due Date:</div>
			<div class="column grid_6">
				<?php echo sbxDateFormat($items->getBidDueDate(),'d/M/Y');?> 
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Booking available for:</div>
			<div class="column grid_6">
				<?php 
					$available_for = array();
					$array = countryZoneDataConfig();
					foreach(explode(',',$items->getAvailableFor()) as $availability){
						$available_for[] = $array[$availability] ;
					}
					echo implode(', ',$available_for);
				?>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Entourage Number:</div>
			<div class="column grid_4">
				<?php echo $items->getEntourageNo();?>  PAX
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Min Bid:</div>
			<div class="column grid_4">
				<?php echo $items->getMinBid();?> USD
			</div>
			
			<div class="clrboth"></div>
			<div class="column grid_2 bold">REQUIREMENTS:</div>
			<div class="clrboth"></div>
			
			<div class="column grid_2">Air Travel:</div>
			<div class="column grid_4">
				<?php $array = coBuyerOrSellerDataConfig(); echo $array[$items->getAirTravel()];?>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Ground:</div>
			<div class="column grid_4">
				<?php $array = coBuyerOrSellerDataConfig(); echo $array[$items->getGround()];?>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Hotel:</div>
			<div class="column grid_4">
				<?php $array = coBuyerOrSellerDataConfig(); echo $array[$items->getHotel()];?>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Per diem:</div>
			<div class="column grid_4">
				<?php $array = coBuyerOrSellerDataConfig(); echo $array[$items->getPerDiem()];?>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Light & Sound:</div>
			<div class="column grid_4">
				<?php $array = coBuyerOrSellerDataConfig(); echo $array[$items->getLightAndSound()];?>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Rider Requirement:</div>
			<div class="column grid_4">
				<?php $array = coBuyerOrSellerDataConfig(); echo $array[$items->getRiderReq()];?>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">VISA & Work Permits:</div>
			<div class="column grid_4">
				<?php $array = coBuyerOrSellerDataConfig(); echo $array[$items->getVisaAndWorkPermits()];?>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Additional Information:</div>
			<div class="column grid_6">
				<?php echo $items->getAdditional();?>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Download tech rider:</div>
			<div class="column grid_4">
				<a href="<?php echo fileTarget($USER->getId(),$items->getTechRider());?>" target="_blank"><?php echo $items->getTechRider();?></a>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Download hospitality rider:</div>
			<div class="column grid_4">
				<?php if($items->getHospitalityRider()): ?>
					<a href="<?php echo fileTarget($USER->getId(),$items->getHospitalityRider());?>" target="_blank"><?php echo $items->getHospitalityRider();?></a>
				<?php endif; ?>
			</div>
			<div class="clrboth"></div>
			<div style="width:0px;height:20px;"></div>
		<?php 
			$ci = & get_instance();
			$MY_ACC = $ci->user_entity->init('id', $_SESSION['user']['id']);
			$isBid = $ci->bid_entity->is_set($MY_ACC->getAccCode(), $items->getRefNo());
		?>	
			<div class="column grid_2">
				&nbsp;
			</div>
			<div class="column grid_6">
				<div id="targetBack" class="red"></div>
				<div class="clrboth"></div>
				<?php if($items->getStatus()== "opening" || $isBid): ?>
					<?php if(! $isBid) :?>
						<input type="button"  id="button_bid" name="button_bid" value="Bid" class="ui-corner-all button-yellow" />
					<?php else: ?>
						<input type="button"  id="button_edit_bid" name="button_edit_bid" value="Edit Bid" class="ui-corner-all button-yellow" />
					<?php endif; ?>	
				<?php endif; ?>
			</div>
		
			<div class="clrboth"></div>
		</div>
	</div>
	
</form>	
</div>
<div class="clrboth"></div>

<?php 
	$secure_bid_link = site_url("buyer/shows/bid/?ref_no=".$items->getRefNo()."&scrid=".md5($items->getRefNo()."&".$items->getId()));
	$edit_bid_link = site_url("buyer/shows/edit_bid/?ref_no=".$items->getRefNo()."&scrid=".md5($items->getRefNo()."&".$items->getId()));
?>

<script type="text/javascript">
	$(function() {
		$('#button_bid').click(function(){
			window.location = '<?php echo $secure_bid_link;?>';
		});
		$('#button_edit_bid').click(function(){
			window.location = '<?php echo $edit_bid_link;?>';
		});
	});
	
</script>